import { getAddress } from '@/utils/auth.js'
export default {
	namespaced: true,
	state: {
		addressList: [],
		addressObj:{},   //key值存储
		
		//表示当前选的展示的默认地址
		nowId:'',
		//订单需要改地址时的ID
		orderAddress:'',
		// 合伙人地址设置选择
		haveSelected:false,
	},
	mutations: {
		// 是否选择合伙人礼包地址
		SET_HAVESELECTEN(state,bool){
			state.haveSelected=bool
		},
		//删除临时选择的地址
		REMOVE_OEDERADDRESS(state ){
			state.orderAddress = '';
		},
		SET_OEDERADDRESS(state,address ){
			state.orderAddress = address;
		},
		//设置初始加载时的默认地址
		SET_DEFAULT(state, id) {
			//当前没有选择的临时ID时才修改
			if(!state.nowId){
				state.nowId = id;
			}
		},
		//当前地址
		SET_NOWID(state, id) {
			state.nowId = id;
		},
		SET_OBJ(state,obj){
			state.addressObj = obj
		},
		SET_LIST(state, list) {
			state.addressList = list;
		},
		CLEAR(state){
			state.addressList = []
			state.addressObj = {}
			state.nowId = ''
			state.orderAddress = ''
		}
	},
	getters: {

	},
}
